<%@page import="chase.myrewards.beans.*"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>

<!DOCTYPE html>
<html>
<head>
<title>Your Account Information</title>
<base href="http://my-rewards.appspot.com/" />
<!-- <base href="http://192.168.1.4:8888/" /> -->
<link rel=stylesheet href="./myrewards.css" type="text/css">
</head>
<body>
	<h2>Your Account Information</h2>
	<jsp:useBean id="accountinfo" type="chase.myrewards.beans.Account"
		scope="session" />
	<% String used = "rewardsusage"; 
           String recently = "recentlyaccrued"; %>
	<table>
		<tr>
			<td>Previous Balance</td>
			<td><jsp:getProperty name="accountinfo"
					property="previousBalance" /></td>
		</tr>
		<tr>
			<td>Used Rewards <a href=<%=used%>>(More Info)</a>
			</td>
			<td><jsp:getProperty name="accountinfo" property="usedPoints" /></td>
		</tr>
		<tr>
			<td>Recently Accrued <a href=<%=recently%>>(More Info)</a>
			</td>
			<td><jsp:getProperty name="accountinfo"
					property="recentlyAccrued" /></td>
		</tr>
		<tr>
			<td>Current Balance</td>
			<td><jsp:getProperty name="accountinfo"
					property="currentBalance" /></td>
		</tr>
		<tr>
			<td>Future Balance <br>(available on <jsp:getProperty
					name="accountinfo" property="cycleDate" />)</td>
			<td><jsp:getProperty name="accountinfo" property="futureBalance" /></td>
		</tr>
	</table>
	<br />
	<table>
        <% if(!accountinfo.getRedeemNum().isEmpty()){ %>
		  <% if(!accountinfo.getRedeemNum().get(0).equalsIgnoreCase("0")){ %>
		      <tr><th>Redeem by Phone</th><td><%=accountinfo.getRedeemNum().get(0)%></td></tr>
		  <% } %>
		  <% for (int i = 1; i < accountinfo.getRedeemNum().size(); i++){ %>
		      <% if(!accountinfo.getRedeemNum().get(i).equalsIgnoreCase("0")){ %>
		          <tr><td></td><td><%=accountinfo.getRedeemNum().get(i)%></td></tr>
		      <% } %>
		  <% } %>
	   <% } %>
	   
	   <% if(!accountinfo.getRedeemUrl().isEmpty()){ %>
          <% if(!accountinfo.getRedeemUrl().get(0).equalsIgnoreCase("0")){ %>
              <tr><th>Redeem by Web</th><td><%=accountinfo.getRedeemUrl().get(0)%></td></tr>
          <% } %>
          <% for (int i = 1; i < accountinfo.getRedeemUrl().size(); i++){ %>
              <% if(!accountinfo.getRedeemUrl().get(i).equalsIgnoreCase("0")){ %>
                  <tr><td></td><td><%=accountinfo.getRedeemUrl().get(i)%></td></tr>
              <% } %>
          <% } %>
       <% } %>
       
       <% if(!accountinfo.getRedeemStore().isEmpty()){ %>
          <% if(!accountinfo.getRedeemStore().get(0).equalsIgnoreCase("0")){ %>
              <tr><th>Redeem at Store</th><td><%=accountinfo.getRedeemStore().get(0)%></td></tr>
          <% } %>
          <% for (int i = 1; i < accountinfo.getRedeemStore().size(); i++){ %>
              <% if(!accountinfo.getRedeemStore().get(i).equalsIgnoreCase("0")){ %>
                  <tr><td></td><td><%=accountinfo.getRedeemStore().get(i)%></td></tr>
              <% } %>
          <% } %>
       <% } %>
       
       <% if(!accountinfo.getRedeemCard().isEmpty()){ %>
          <% if(!accountinfo.getRedeemCard().get(0).equalsIgnoreCase("0")){ %>
              <tr><th>Redeem with Card</th><td><%=accountinfo.getRedeemCard().get(0)%></td></tr>
          <% } %>
          <% for (int i = 1; i < accountinfo.getRedeemCard().size(); i++){ %>
              <% if(!accountinfo.getRedeemCard().get(i).equalsIgnoreCase("0")){ %>
                  <tr><td></td><td><%=accountinfo.getRedeemCard().get(i)%></td></tr>
              <% } %>
          <% } %>
       <% } %>
	</table>
</body>
</html>